include $(top_srcdir)/automake/multilib.am
include $(top_srcdir)/automake/compile.am

SUBDIRS = src/nfsclient

EXTRA_DIST = README

noinst_LIBRARIES = libdefaultfs.a
libdefaultfs_a_SOURCES = \
    src/defaults/default_clone.c \
    src/defaults/default_are_nodes_equal.c \
    src/defaults/default_lock_and_unlock.c \
    src/defaults/default_eval_path.c \
    src/defaults/default_fchmod.c src/defaults/default_freenode.c \
    src/defaults/default_fsync.c \
    src/defaults/default_fsync_success.c \
    src/defaults/default_link.c \
    src/defaults/default_read.c src/defaults/default_rmnod.c \
    src/defaults/default_chown.c \
    src/defaults/default_fcntl.c \
    src/defaults/default_ftruncate.c src/defaults/default_lseek.c \
    src/defaults/default_lseek_file.c \
    src/defaults/default_lseek_directory.c \
    src/defaults/default_readlink.c src/defaults/default_statvfs.c \
    src/defaults/default_utime.c \
    src/defaults/default_fstat.c \
    src/defaults/default_ioctl.c src/defaults/default_mount.c \
    src/defaults/default_rename.c src/defaults/default_symlink.c \
    src/defaults/default_write.c \
    src/defaults/default_unmount.c \
    src/defaults/default_open.c src/defaults/default_close.c \
    src/defaults/default_fsunmount.c src/defaults/default_mknod.c \
    src/defaults/default_ftruncate_directory.c \
    src/defaults/default_handlers.c src/defaults/default_ops.c
libdefaultfs_a_SOURCES += src/defaults/default_kqfilter.c
libdefaultfs_a_SOURCES += src/defaults/default_poll.c
libdefaultfs_a_SOURCES += src/defaults/default_readv.c
libdefaultfs_a_SOURCES += src/defaults/default_writev.c

noinst_LIBRARIES += libimfs.a
libimfs_a_SOURCES =

libimfs_a_SOURCES += src/imfs/deviceio.c \
    src/imfs/fifoimfs_init.c src/imfs/imfs_chown.c src/imfs/imfs_config.c \
    src/imfs/imfs_creat.c src/imfs/imfs_directory.c \
    src/imfs/imfs_eval.c src/imfs/imfs_fchmod.c \
    src/imfs/imfs_fifo.c \
    src/imfs/imfs_make_generic_node.c \
    src/imfs/imfs_fsunmount.c \
    src/imfs/imfs_handlers_device.c \
    src/imfs/imfs_handlers_directory.c \
    src/imfs/imfs_handlers_memfile.c src/imfs/imfs_init.c \
    src/imfs/imfs_initsupp.c src/imfs/imfs_link.c src/imfs/imfs_load_tar.c \
    src/imfs/imfs_mknod.c src/imfs/imfs_mount.c \
    src/imfs/imfs_rename.c src/imfs/imfs_rmnod.c \
    src/imfs/imfs_stat.c src/imfs/imfs_symlink.c \
    src/imfs/imfs_unmount.c src/imfs/imfs_utime.c src/imfs/ioman.c \
    src/imfs/memfile.c src/imfs/miniimfs_init.c src/imfs/imfs.h

# POSIX FIFO/pipe
libimfs_a_SOURCES += src/pipe/fifo.c src/pipe/pipe.c src/pipe/pipe.h

noinst_LIBRARIES += libdevfs.a
libdevfs_a_SOURCES = src/devfs/devfs_init.c src/devfs/devfs_eval.c \
    src/devfs/devfs_mknod.c src/devfs/devfs_show.c \
    src/devfs/devopen.c src/devfs/devread.c \
    src/devfs/devwrite.c src/devfs/devclose.c src/devfs/devioctl.c \
    src/devfs/devstat.c src/devfs/devfs.h

# dosfs
if LIBDOSFS
noinst_LIBRARIES += libdosfs.a

# libdosfs_FATFS_C_FILES
libdosfs_a_SOURCES = src/dosfs/fat.c src/dosfs/fat.h \
    src/dosfs/fat_fat_operations.c src/dosfs/fat_fat_operations.h \
    src/dosfs/fat_file.c src/dosfs/fat_file.h

# libdosfs_DOSFS_C_FILES
libdosfs_a_SOURCES += src/dosfs/msdos_create.c src/dosfs/msdos_dir.c \
    src/dosfs/msdos_eval.c src/dosfs/msdos_file.c src/dosfs/msdos_free.c \
    src/dosfs/msdos_fsunmount.c src/dosfs/msdos_handlers_dir.c \
    src/dosfs/msdos_handlers_file.c src/dosfs/msdos_init.c \
    src/dosfs/msdos_initsupp.c src/dosfs/msdos_misc.c \
    src/dosfs/msdos_mknod.c \
    src/dosfs/msdos_rmnod.c src/dosfs/msdos_statvfs.c \
    src/dosfs/msdos_conv_default.c \
    src/dosfs/msdos_conv_utf8.c \
    src/dosfs/msdos_conv.c src/dosfs/msdos.h src/dosfs/msdos_format.c \
    src/dosfs/dosfs.h src/dosfs/msdos_rename.c
endif

# RFS
noinst_LIBRARIES += librfs.a
librfs_a_SOURCES = \
    src/rfs/rtems-rfs-bitmaps.c src/rfs/rtems-rfs-block.c \
    src/rfs/rtems-rfs-buffer-bdbuf.c src/rfs/rtems-rfs-buffer.c \
    src/rfs/rtems-rfs-dir-hash.c src/rfs/rtems-rfs-file.c \
    src/rfs/rtems-rfs-group.c src/rfs/rtems-rfs-inode.c \
    src/rfs/rtems-rfs-rtems-dev.c src/rfs/rtems-rfs-rtems-utils.c \
    src/rfs/rtems-rfs-rtems.c src/rfs/rtems-rfs-shell.c \
    src/rfs/rtems-rfs-dir.c \
    src/rfs/rtems-rfs-file-system.c src/rfs/rtems-rfs-format.c \
    src/rfs/rtems-rfs-link.c src/rfs/rtems-rfs-mutex.c \
    src/rfs/rtems-rfs-rtems-dir.c src/rfs/rtems-rfs-rtems-file.c \
    src/rfs/rtems-rfs-trace.c

# JFFS2
noinst_LIBRARIES += libjffs2.a
libjffs2_a_SOURCES =
libjffs2_a_SOURCES += src/jffs2/src/build.c
libjffs2_a_SOURCES += src/jffs2/src/compat-crc32.c
libjffs2_a_SOURCES += src/jffs2/src/compat-rbtree.c
libjffs2_a_SOURCES += src/jffs2/src/compr.c
libjffs2_a_SOURCES += src/jffs2/src/compr_rtime.c
libjffs2_a_SOURCES += src/jffs2/src/compr_zlib.c
libjffs2_a_SOURCES += src/jffs2/src/debug.c
libjffs2_a_SOURCES += src/jffs2/src/dir-rtems.c
libjffs2_a_SOURCES += src/jffs2/src/erase.c
libjffs2_a_SOURCES += src/jffs2/src/flashio.c
libjffs2_a_SOURCES += src/jffs2/src/fs-rtems.c
libjffs2_a_SOURCES += src/jffs2/src/gc.c
libjffs2_a_SOURCES += src/jffs2/src/malloc-rtems.c
libjffs2_a_SOURCES += src/jffs2/src/nodelist.c
libjffs2_a_SOURCES += src/jffs2/src/nodemgmt.c
libjffs2_a_SOURCES += src/jffs2/src/read.c
libjffs2_a_SOURCES += src/jffs2/src/readinode.c
libjffs2_a_SOURCES += src/jffs2/src/scan.c
libjffs2_a_SOURCES += src/jffs2/src/write.c
libjffs2_a_CFLAGS =
libjffs2_a_CFLAGS += -Wno-pointer-sign
libjffs2_a_CPPFLAGS =
libjffs2_a_CPPFLAGS += $(AM_CPPFLAGS) -I$(srcdir)/src/jffs2/include
libjffs2_a_CPPFLAGS += -D__ECOS
libjffs2_a_CPPFLAGS += '-DKBUILD_MODNAME="JFFS2"'

# ---
include $(srcdir)/preinstall.am
include $(top_srcdir)/automake/subdirs.am
include $(top_srcdir)/automake/local.am
